<?php

namespace App\Http\Controllers\Api;

use App\Consts\GlobalConst;
use App\Http\Controllers\BaseController;
use Illuminate\Http\Request;

class ProController extends BaseController
{
    public $validate = [];

    /**
     * @path /pro/recommend-list
     * @category 智囊团
     * @title 推荐列表
     * @method POST
     * @params [{"name":"page","type":"text","required":1,"example":"","desc":"页数，默认是1"}]
     * @resBody {"success":true,"statusCode":200,"result":{"total_count":1,"page_size":20,"page":1,"list":[{"id":"智囊团ID","avatar":"智囊团头像，如1.jpg","nickname":"智囊团昵称","description":"智囊团简介","qrcode":"微信二维码图片","category":{"id":1,"name":"智囊团分类名称"}}]},"message":"OK"}
     */
    public function recommendList(Request $request)
    {
        $params = $request->post();
        $searchParams = [
            'page' => !empty($params['page']) ? $params['page'] - 1 : 0,
            'page_size' => GlobalConst::PAGE_COUNT_FIVE,
        ];

        $proList = service()->ProService->getRecommendProList($searchParams);

        return $this->apiReturn($proList);
    }
}
